Fix usleep definition -- we would be sleeping 1000 times too long if the usleep
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 7 Dec 2005 15:41:41 +0000 (15:41 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 7 Dec 2005 15:41:41 +0000 (15:41 +0000)
command were not available elsewhere on the machine (on my Debian boxes, for
example).

Sleep for a configurable amount of time between xm create calls (by default,
5 seconds).  This spaces out the booting of the new domains, meaning that they
should not thrash the disk so much.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/init.d/sysconfig.xendomains
tools/examples/init.d/xendomains

index fa95c145cc7b06a51576390c7b53db307b272e42..e93b1a40b9d45c2218517e3eda65e7f9d68fcf69 100644 (file)
@@ -20,6 +20,17 @@ XENDOMAINS_SYSRQ=""
 #
 XENDOMAINS_USLEEP=100000
 
+## Type: integer
+## Default: 5000000
+#
+# When creating a guest domain, it is sensible to allow a little time for it
+# to get started before creating another domain or proceeding through the
+# boot process.  Without this, the booting guests will thrash the disk as they
+# start up.  This timeout (in microseconds) specifies the delay after guest
+# domain creation.
+#
+XENDOMAINS_CREATE_USLEEP=5000000
+
 ## Type: string
 ## Default: ""
 #
index 4d7db36295562f20435679e281a601a35698982b..23d53efea415e2f1157224230ee74e8950ac4770 100644 (file)
@@ -127,7 +127,7 @@ then
   {
     if [ -n "$1" ]
     then
-      sleep $(( $1 / 1000 ))
+      sleep $(( $1 / 1000000 ))
     fi
   }
 fi
@@ -241,6 +241,8 @@ start()
                if [ $? -ne 0 ]; then
                    rc_failed $?
                    echo -n '!'
+               else
+                   usleep $XENDOMAINS_CREATE_USLEEP
                fi
            fi
        done